package com.study.unicom;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * 联通请求和响应类
 *
 * @author ：ihao ∶）
 * @date ：Created in 2020-12-16 14:42
 */
public class UnifiedScoreBaseParam {

    @Data
    public static class BaseResponse {
        private String respCode;
        private String respDesc;
        private BaseResult result;
    }

    @Data
    public static class BaseResult {
        private String code;
        private String message;
        private String content;
        @JSONField(name = "UNI_BSS_BODY")
        private UniBssBody uniBssBody;
    }

    @Data
    public static class UniBssBody {
        @JSONField(name = "RISK_CONTROL_DECISION_RSP")
        private RiskControllerResponse riskControllerResponse;
    }

    @Data
    @Builder
    public static class UnifiedCoinReq {
        private String downAppId;
        private String downTime;
        private String serviceNo;
        private String areaNo;
        private String dxflag;
        private String dxcode;
    }

    @Data
    @Builder
    public static class OrderBillReq {
        private String appId;
        private String sufCreateTime;
        private String pageNum;
        private String pageSize;
    }

    @Data
    @Builder
    public static class OrderBillRsp {
        private String goodsName;
        private String goodsPrice;
        private String goodFloorPrice;
        private String serviceNo;
        private String sufCreateTime;
        private String OrderState;
        private String backState;
        private String netType;
        private String awardScore;
        private String teleScore;
        private String awardScoreDx;
        private String pOrderNo;
        private String provinceCode;
        private String supplierNo;
        private String supplierName;
        private String goodsSupName;
        private String goodsIds;
        private String paySerialNum;
        private String goodsTaxRate;
        private String Settleflag;
        private String appId;
        private String sufObtainTime;
    }

    @Data
    public static class UnifiedCoinRsp {
        private Integer awardScore;
        private Integer teleScore;
        @JSONField(name = "invalid_awardScore")
        private Integer invalidAwardScore;
        @JSONField(name = "invalid_teleScore")
        private Integer invalidTeleScore;
        @JSONField(name = "dxscore_list")
        private List<DxScore> dxscoreList;
        private Integer availableScore;
        private Integer totalScore;
        private Integer expireScore;
        private String message;
        private boolean status;
    }

    @Data
    public static class DxScore {
        private String booksType;
        private Integer balance;
        private Integer needexpNumber;
        private String unit;
    }

    @Data
    @Builder
    public static class SubScoreReq {
        private String downAppId;
        private String downTime;
        private String placeOrderSerialNum;
        private String serviceNo;
        private String serviceCode;
        private String goodsIds;
        private String goodsNum;
        private String channelCode;
        private String channelName;
        private String areaNo;
        private String ecstoken;
        private String goodsMessage;
    }

    @Data
    @Builder
    public static class SubScoreRsp {
        private String pOrderNo;
        private String OrderState;
        private String awardScore;
        private String awardOrderNo;
        private String serviceNo;
        private String teleScore;
        private String pSerialNo;
        private String tranIdo;
        private String orderNo;
        private String dxOrderNo;
        private String awardScoreDx;
        private String paySerialNum;
        private String message;
        private boolean status;
    }

    @Data
    @Builder
    public static class RollbackScoreReq {
        private String downAppId;
        private String downTime;
        private String serviceNo;
        private String areaNo;
        private String placeOrderSerialNum;
        private String serviceCode;
    }

    @Data
    @Builder
    public static class RollbackScoreRsp {
        private String awardBack;
        private String teleBack;
        private String awardBack_dx;
        private String message;
        private boolean status;
    }

    @Data
    @Builder
    public static class OrderSelectReq {
        private String downAppId;
        private String downTime;
        private String serviceNo;
        private String placeOrderSerialNum;
        private String serialNum;
        private String operType;
        private String serviceCode;
    }

    @Data
    @Builder
    public static class OrderSelectRsp {
        private Integer awardScore;
        private Integer teleScore;
        private Integer awardScore_dx;
        private String operType;
        private String spendtime;
        private String orderNo;
        private String message;
        private boolean status;
        private String pOrderNo;
    }

    @Data
    @Builder
    public static class UNI_BSS_BODY {
        @JSONField(name = "RISK_CONTROL_DECISION_REQ")
        RiskControllerRequest request;
    }

    @Data
    @Builder
    public static class RiskControllerRequest {

        @JSONField(name = "USER_ID")
        private String userId;

        @JSONField(name = "RISK_CONTROL_CODE")
        private String riskControlCode;

        @JSONField(name = "SCENE_CODE")
        private String sceneCode;

        @JSONField(name = "AGENCY_ID")
        private String agencyId;

        @JSONField(name = "USER_IP")
        private String userIp;

        @JSONField(name = "MAIN_USER_ID")
        private String mainUserId;

        @JSONField(name = "APPID")
        private String appId;

        @JSONField(name = "IMEI")
        private String imei;

        @JSONField(name = "URL_REF")
        private String urlRef;

        @JSONField(name = "TRADE_ID")
        private String tradeId;

        @JSONField(name = "TRADE_NAME")
        private String tradeName;

        @JSONField(name = "ACTIVITY_ID")
        private String activityId;

        @JSONField(name = "ACTIVITY_NAME")
        private String activityName;

        @JSONField(name = "ACTIVITY_TYPE")
        private String activityType;

        @JSONField(name = "TOTAL_AMOUNT")
        private String totalAmount;

        @JSONField(name = "SINGLE_USER_AMOUNT")
        private String singleUserAmount;

        @JSONField(name = "ACTIVITY_USER_NUM")
        private String activityUserNum;

        @JSONField(name = "START_TIME")
        private String startTime;

        @JSONField(name = "END_TIME")
        private String endTime;
    }

    @Data
    public static class RiskControllerResponse {

        @JSONField(name = "RESP_CODE")
        private String respCode;

        @JSONField(name = "RESP_DESC")
        private String respDesc;

        @JSONField(name = "RESP_INFO")
        private RespInfo respInfo;

        @Data
        public static class RespInfo {
            @JSONField(name = "USER_ID")
            private String userId;

            @JSONField(name = "RISK_CONTROL_CODE")
            private String riskControlCode;

            @JSONField(name = "RISK_CONTROL_NAME")
            private String riskControlName;

            @JSONField(name = "RETURN_CODE")
            private String returnCode;

            @JSONField(name = "RETURN_NAME")
            private String returnName;
        }
    }

}
